package com.zxx.flowerstore.service;

import com.zxx.flowerstore.entity.FlowerUser;
import com.zxx.flowerstore.utils.common.Result;

/**
 * @ClassName UserService
 * @Author Admin
 * @Date 2021/3/16 20:44
 * @Description UserService
 * @Version 1.0
 */
public interface UserService {

    /**
     *  注册
     * @param flowerUser
     * @return
     */
    Result register(FlowerUser flowerUser);

    /**
     *  发送邮件验证码
     * @param flowerUser
     * @return
     */
    Result sendEmailCode(FlowerUser flowerUser);


    /**
     *  校验注册信息  解耦
     * @param flowerUser
     */
    void checkRegisterInfo(FlowerUser flowerUser);


    /**
     *  创建用户 解耦
     * @param flowerUser
     */
    void createUser(FlowerUser flowerUser) throws Exception;

    /**
     *  用户登录
     * @param flowerUser
     * @return
     */
    Result login(FlowerUser flowerUser);


    /**
     *  登录参数校验 解耦
     * @param flowerUser
     */
    void checkLoginInfo(FlowerUser flowerUser) throws Exception;

    /**
     *  忘记密码
     * @param flowerUser
     * @return
     */
    Result forgetPassword(FlowerUser flowerUser);

    /**
     *  获取redis中保存的邮件验证码信息
     * @param flowerUser
     * @return
     */
    String getRedisCode(FlowerUser flowerUser);

    /**
     *  修改密码
     * @param flowerUser
     * @return
     */
    Result updatePassword(FlowerUser flowerUser);
}
